<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script>
    autoCompleteDict("vitalSigns");
    function autoCompleteDict(inputId) {
        var url = "${ctx}/nurse/nurseTempItemDict/autoComplete?type=${nurseVitalSignsRec.tempItem.nurseGroups}";
        autoComplete(inputId, url,
                function (data) {
                    var rows = [];
                    for (var i = 0; i < data.length; i++) {
                        rows[rows.length] = {
                            data: data[i],
                            value: data[i].id,
                            result: data[i].vitalSigns
                        };
                    }
                    return rows;
                }, function (data, i, max) {
                    return data.vitalCode + "  " + data.vitalSigns;
                }, function (event, data, formatted) {
                    $('#tempItemId').attr('value', data.id);
                    $('#vitalCode').attr('value', data.vitalCode);
                    $('#classCode').attr('value', data.classCode);
                    $('#className').attr('value', data.className);
                    $('#units').attr('value', data.unit);
                });
    }

</script>
<div class="panel-body">
    <div class="col-lg-12">
        <form:form id="inputVitalForm" data-parsley-validate="" modelAttribute="nurseVitalSignsRec"
                   onsubmit="return saveEvent('eventDiv','inputVitalForm','${ctx}/nurse/nurseVitalSignsRec/save','${ctx}/nurse/nurseVitalSignsRec/index');"
                   method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <form:hidden path="patientId"/>
            <form:hidden path="visitId"/>
            <form:hidden path="tempItem.id" id="tempItemId"/>
            <form:hidden path="tempInfo.id"/>
            <form:hidden path="vitalSignsValues"/>
            <form:hidden path="vitalSignsCvalues"/>
            <form:hidden path="units" id="units"/>
            <form:hidden path="classCode" id="classCode" htmlEscape="false" class="form-control"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">项目事件：</label>

                <div class="col-sm-9">
                    <form:hidden path="vitalCode" id="vitalCode" htmlEscape="false" class="form-control"
                                 maxlength="10"/>
                    <form:input path="vitalSigns" id="vitalSigns" htmlEscape="false" class="form-control"
                                maxlength="100" data-parsley-required="true"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">时间：</label>

                <div class="col-sm-9">
                    <input name="timePoint" class="form-control Wdate" maxlength="100" data-parsley-required="true"
                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                           value="${fns:getDate('yyyy-MM-dd HH:mm:ss')}"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <input id="btn" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                    <input id="btnCancel" class="btn" type="button" value="返 回" onclick="closeDiv()">
                </div>
            </div>
        </form:form>
    </div>
</div>